<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      .box {
        border: 1px #000 solid;
        width: 200px;
      }
      header {
        background-color: #b6b9c7;
        height: 30px;
        display: flex;
        justify-content: space-around;
        align-items: center;
      }
      span {
        display: block;
        border-left: 10px solid rgba(0, 0, 0, 0);
        border-top: #000 solid 10px;
        border-right: rgba(0, 0, 0, 0) solid 10px;
      }
      li {
        list-style-type: none;
        margin-top: 5px;
        background-color: #e0e2eb;
      }
      li:hover {
        text-decoration: underline;
        background-color: #fff;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <header>
        <p>播放列表</p>
        <span id="show"></span>
      </header>
      <ul id="ul">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
      </ul>
    </div>
  </body>
</html>
<script>
  var ul = document.getElementById("ul");
  var show = document.getElementById("show");
  show.onclick = function () {
    if (ul.style.display != "none") {
      ul.style.display = "none";
      show.style.cssText =
        "  border-left: 10px solid rgba(0, 0, 0, 0);border-top:0; border-bottom: #000 solid 10px;border-right: rgba(0, 0, 0, 0) solid 10px;";
    } else {
      ul.style.display = "block";
      show.style.cssText =''
    }
  };
</script>
